/*
 * Copyright (c) 2023 Huawei Technologies Co., Ltd.
 * openUBMC is licensed under Mulan PSL v2.
 * You can use this software according to the terms and conditions of the Mulan PSL v2.
 * You may obtain a copy of Mulan PSL v2 at:
 *         http://license.coscl.org.cn/MulanPSL2
 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
 * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
 * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
 * See the Mulan PSL v2 for more details.
 */

#include "pcie_transport.h"

namespace dev {

bool transport_object::init(mc::dict& object) {
    try {
        from_variant(object, *this);
    } catch (const std::exception& e) {
        elog("transport_object init failed, exception: ${exception}", ("exception", e.what()));
        return false;
    }
    return true;
}

} // namespace dev

MC_REFLECT(dev::transport_interface,
           ((m_service_name, "ServiceName"))((m_target_eid, "TargetEid"))(
               (m_target_phy_addr, "TargetPhyAddr"))((m_message_type, "MessageType")));
MC_REFLECT(dev::transport_object,
           ((m_transport_interface, "bmc.kepler.Systems.Mctp.PCIeTransport")))
